package com.example.myapplication.dialog

import android.app.Dialog
import android.os.Bundle
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AlertDialog
import androidx.fragment.app.DialogFragment
import com.example.myapplication.R
import com.example.myapplication.databinding.DialogInputBinding

/**
 * @description:
 *
 * @author: wangrongfeng
 *
 * @create: 2023-07-26 17:14
 **/
class InputDialog : DialogFragment() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

    }

//    override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
//        val binding = DialogInputBinding.inflate(LayoutInflater.from(context))
//        val builder = AlertDialog.Builder(requireActivity())
//        builder.setView(binding.root)
//        return builder.create()
//    }

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        val view: View = inflater.inflate(R.layout.dialog_input, container, false)
        return view
    }

    override fun onStart() {
        super.onStart()
        dialog?.window?.attributes?.let {
            it.gravity = Gravity.BOTTOM
        }
    }


}